package com.kevin.spring.aop.aspectj;

import org.aspectj.lang.ProceedingJoinPoint;
import org.springframework.stereotype.Component;

@Component
public class MyInterceptor2 {

	public void before(String name) {
		System.out.println("this is 前置通知" + name);
	}

	/*
	 * public void before() { System.out.println("this is 前置通知"); }
	 */

	public void afterReturning(String result) {
		System.out.println("this is 后置通知" + result);
	}

	public void after(String name) {
		System.out.println("this is 最终通知");
	}

	public Object doBasicProfiling(ProceedingJoinPoint pjp) throws Throwable {

		System.out.println("进入方法");
		Object result = pjp.proceed();
		System.out.println("退出方法");

		return result;
	}

	public void afterThrowing() {
		System.out.println("this is @AfterThrowing通知");
	}
}
